package QL;

import java.util.List;
import java.util.ArrayList;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

public class ButlerCdkeyCodeInfo implements IQLResponse
{
    /// <summary>
    /// 激活码唯一标识
    /// </summary>
    public long Id;

    /// <summary>
    /// 激活码
    /// </summary>
    public String Key;

    /// <summary>
    /// 0未使用 1已使用 2已废弃
    /// </summary>
    public long Status;

    /// <summary>
    /// 使用者的玩家Id
    /// </summary>
    public long UserId;

    /// <summary>
    /// 使用者的昵称
    /// </summary>
    public String Nickname;

    /// <summary>
    /// 领取时间
    /// </summary>
    public String FetchedTime;

    @Override
    public void DeserializeFromJson(JSONObject jsonObj)
    {
        JSONObject t = jsonObj;
        if (t.has("id"))
            Id = t.getLong("id");
        if (t.has("key"))
            Key = t.getString("key");
        if (t.has("status"))
            Status = t.getLong("status");
        if (t.has("user_id"))
            UserId = t.getLong("user_id");
        if (t.has("nickname"))
            Nickname = t.getString("nickname");
        if (t.has("fetched_time"))
            FetchedTime = t.getString("fetched_time");
    }
}
